<?php
/*********************************************************************\
* This File is a part of BH-PANEL (Breizh-Heberg Panel v2.1)
* Copyright (C) 2008-2009 the BH Developpers : Vincent Giersch <mail@vincordi.fr>, Cyprien Laleau <fanning.fr@gmail.com> and Edwin Cabiten <marmottes44@hotmail.fr>
* See file AUTHORS to get more informations

* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.

* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.

* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
/*********************************************************************/


	define('CURRENT_SERVER', 3);
	define('TMP_PASS', 'KaflPmKVygEV65L');
	define('OVH_host', 'ftpback4.ovh.net');
	define('OVH_login', 'ks359703.kimsufi.com');
	define('OVH_pass', 'MaiY9Jqpj');
	
	$name_back = "backup_ns3_31_07_2008_11_20_46";	
//	$name_back = "backup_ns".CURRENT_SERVER."_".date("d_m_Y_h_i_s");
//	shell_exec("sudo tar cf /opt/hosting/backups/$name_back.tar /home/");
	// Send to ns0
	//$_ftp_co = ftp_connect("ns0.breizh-heberg.net");
	//$_ftp_log = ftp_login($_ftp_co, "back", TMP_PASS);
	//if(ftp_put($_ftp_co, "/backups/$name_back.tar", "/opt/hosting/backups/$name_back.tar", FTP_BINARY)) {
	//	echo "BACKUP on ns0 ... OK"."\n";
	//}
	
	// Send to OVH backup server
	$_ftp_co = ftp_connect(OVH_host);
	$_ftp_log = ftp_login($_ftp_co, OVH_login, OVH_pass);
	if(ftp_put($_ftp_co, "$name_back.tar", "/opt/hosting/backups/$name_back.tar", FTP_BINARY)) {
		echo "BACKUP on OVH Backup server ... OK";
	}

?>
